************

INTRODUCTION

************


This file describes how to set up and use the PHP wrapper code for Melissa DATA's Address Object.


*************

PREREQUISITES

*************



To make use of the Address Object PHP wrapper you will need:


* An installation of a PHP. Wrapper tested with PHP 5.2.6.


* The Melissa DATA Address Object library and data files installed.

  These files are installed automatically if you run setup.exe. By default, the Address Object 

  Library (mdAddr.dll) is installed in:

	C:\Program Files\Melissa DATA\DQT\AddrObj\dll_32bit

* 64bit version available in C:\Program Files\Melissa DATA\DQT\AddrObj\dll_64bit

  and the Address Object data files in:

	C:\Program Files\Melissa DATA\DQT\Data



Note For PHP 5.3.X:


The current SWIG source file 'mdAddrPHPWrapper.cpp' on the disc is not compatible with PHP Version 5.3.X.

The SWIG wrapper was compiled using PHP 5.2.X which uses the zend_error_noreturn() function. This function is no longer avialable in PHP 5.3.X.

To use 'mdAddrPHPWrapper.dll' with PHP 5.3.X, you need to make changes in 'mdAddrPHPWrapper.cpp' manually.

Open 'mdAddrPHPWrapper.cpp' in a text editor and replace all zend_error_noreturn with zend_error. After making these changes in 'mdAddrPHPWrapper.cpp', compile the wrapper again using the 'CreateDll.bat' file.


You will need to know the location of these items in order to install and run the PHP wrapper.


**********************
Wrapper compatibility
**********************

If the provided pre-compiled wrappers are not compatible with your environment, the necessary files for compilation can be found in the 'interfaces' folder of the object's main directory.




***********

Demo Mode

***********



Without a valid license string, Address Object will function in Demo mode. While in Demo mode, Address Object will only validate addresseses in Nevada. Please contact your sales representative to obtain a fully functional license string. Please call 1-800-MELISSA ext. 3 for more information.





*************

Installation

*************



Copy the entire folder that contains this readme.txt into a local directory on your computer.





*****

Files

*****



Here is a brief overview of the files contained in the sample.



AddressSample_cmd.php is a script sample that you can run from the command line. 

AddressObjectPHPSample.php is a php webpage that you can host on a local webserver. 

mdAddrPHPWrapper.php is a php file that is called by the sample code. This file will load the 

	php_mdAddrPHPWrapper.dll extension.

php_mdAddrPHPWrapper.dll is the php extension.

mdAddr.dll is the Address Object engine, not present in this directory. However, you may need a

	copy of this dll, which is installed to C:\Program Files\Melissa DATA\DQT\AddrObj\dll_32bit

	by default.



*****

Setup

*****



1. You will need to tell PHP where to load the php_mdAddrPHPWrapper.dll extension. 

   To do so, you can do one of the following:

	

	Copy php_mdAddrPHPWrapper.dll to your PHP extension folder, usually 

	"C:\Program Files\PHP\ext" by default



	or



	Alter the php extension folder by changing php.ini.

		extension_dir ="C:\Program Files\PHP\ext"



2. If you are using the sample script AddressSample_cmd.php:



	Open a command window. 



	Adding the directory containing mdAddr to your PATH environment variable. 

	ex: set PATH=%PATH%;C:\Program Files\Melissa DATA\DQT\AddrObj\dll_32bit

	* 64bit version available in C:\Program Files\Melissa DATA\DQT\AddrObj\dll_64bit



	type "php AddressSample_cmd.php" to execute the script



3. If you are using the web page sample PHPDemo.php or AddressObjectPHPSample.php:



	Copy PHPDemo.php and mdAddrPHPWrapper.php to your webserver (ie: C:\Inetpub\wwwroot)



	Copy mdAddr.dll into the PHP directory (usually C:\Program Files\PHP) or the same directory as

	mdAddrPHPWrapper.php.

	

	Open up the sample in a browser (IE: http://localhost/PHPDemo.php)







**************************

Setting up the Sample Code

**************************



Open AddressSample_cmd.php for editing. You must set the a license string that you receive from your Melissa Data

	#Put License and Directory of Address Object Data Files here

	$License = "License Here";

	$DataPath = "C:\Program Files\Melissa Data\DQT\Data";



For AddressObjectPHPSample.php, you must do the sample thing and set the License and DataPath:

	//******************************************************//

	//Put License String and Path to Address Object Data Files//

	//******************************************************//

	$License="License Here";

	$DataPath="C:/Program Files/Melissa Data/DQT/Data";



*******

Updates

*******



The files generated/included in this wrapper do not need to be changed for DQ Suite updates unless there is a method signature change in the object. If a new method is added, you will need to rebuild the wrapper to use the new method. 





****

Note

****



Here are some general solutions if you run into problems:



Q. I get an error saying "Unable to load dynamic library. The Specified module cannot be found"

A. This means that either mdAddrPHPWrapper.php cannot find php_mdAddrPHPWrapper.dll, or php_mdAddrPHPWrapper.dll cannot find mdAddr.dll. Make sure to follow all the instructions in the Setup section above. 



Q. I get an error saying "Unable to load dynamic library. Access is denied"

A. This means that either PHP or your webserver does not have the correct permissions to access mdAddr.dll or php_mdAddrPHPWrapper.dll. Make sure the directories containing these dlls are granted the necessary permissions.





Q. I get "Cannot find mdAddr.dat" initialize error but I am pointing to the right path.

A. This could also be a permission issue. Make sure PHP and you web server have the required permissions to the directory containing the data files.



Q. I get an error saying "can't find php5ts.dll."

A. The current php_mdAddrPHPWrapper.dll was compiled using PHP 5.2.6. You are probably using another version of PHP that is not compatible. You will need another version of php_mdAddrPHPWrapper.dll that uses the version of PHP on your system. Please look in the "Source" folder and read the readme for instructions. 





COPYRIGHT NOTICE



(C) 2014 Melissa Data Corporation. All rights reserved.

